#ifndef __CsvUtil_H__
#define __CsvUtil_H__

#include "cocos2d.h"
#include "CsvData.h"
#include "CsvReader.h"
USING_NS_CC;

class CsvUtil : public Ref{
public:
	static CsvUtil* getInstance();
	virtual bool init();

	void loadFile(const char* sPath);
	Value getValue(int iRow, int iCol, const char* csvFilePath);
	const std::string get(int iRow, int iCol, const char* csvFielPath);
	const int getInt(int iRow, int iCol, const char* csvFilePath);
	const float getFloat(int iRow, int iCol, const char* csvFilePath);
	const bool getBool(int iRow,int iCol, const char* csvFilePath);
	const Size getFileRowColNum(const char* csvFilePath);

	const int findValueInWithLine(const char* chValue, int iValueCol, const char* csvFilePath);
private:
	static CsvUtil* m_CsvUtil;
	Map<std::string, CsvData*> m_CsvMap;
};

#endif //__CsvUtil_H__